//提莫攻击
//测试链接 https://leetcode.cn/problems/teemo-attacking/
public class FindPoisonedDuration {
    public int findPoisonedDuration(int[] timeSeries, int duration) {
        int total = 0;

        for(int i = 1; i < timeSeries.length; i++){
            int time = timeSeries[i] - timeSeries[i-1];
            if(time >= duration){
                total += duration;
            }else{
                total += time;
            }
        }

        return total+duration;
    }
}
